package jw.repository.agent;


import jw.model.agent.WxAgent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface WxAgentRepository extends JpaRepository<WxAgent,Integer>, JpaSpecificationExecutor<WxAgent> {

    WxAgent findByOpenId(String openId);

    @Query("select a from WxAgent a where a.parentCode =?1 and a.parentCode <> a.code")
    List<WxAgent>findByParentCode(String parentCode);

}
